//2009/08/14 03:37:28
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <sstream>
#include <algorithm>

using namespace std;

class Chivalry
{
public:
    string getOrder(string first, string second)
    {
        int dex1=0;
        int dex2=0;
        string s;
        while ((dex1<first.size()) && (dex2<second.size()))
        {
            if (first[dex1] == 'W')
            {
                s += first[dex1++];
                continue;
            }
            if (second[dex2] == 'W')
            {
                s += second[dex2++];
                continue;
            }
            s += 'M';
            dex1++;
        }
        while (dex1 < first.size()) s += first[dex1++];
        while (dex2 < second.size()) s += second[dex2++];
        return s;
    }
};
